<!--添加机型-->
<div class="dialog_content">
	<form id="info_form" name="info_form" action="{:u('model/edit')}" method="post">
	<table width="100%" class="table_form">
		<tr> 
	      <th width="80">{:L('model_name')} :</th>
	      <td><input type="text" name="name" value="{$info.name}" id="J_name" class="input-text"></td>
	    </tr>
        

		<tr> 
	      <th width="80">{:L('brand_name')} :</th>
	      <td>
      	     <select name="brandId">
                <option value="0">{:L('please_select')}</option>
	        	<volist name="brandList" id="val" >
	        	<option  <if condition="$info.brandId eq $key">selected="true"</if>  value="{$key}">{$val}</option>
	            </volist>
	        </select>
          </td>
	    </tr> 
        <tr>
            <th>{:L('model_is_head')} :</th>
            <td>
                <input type="radio" name="isHead" <if condition="$info.isHead eq 1">checked="true"</if> class="radio_style" value="1" > &nbsp;{:L('yes')}&nbsp;&nbsp;&nbsp;
                <input type="radio" name="isHead" class="radio_style" <if condition="$info.isHead eq 0">checked="true"</if> value="0"> &nbsp;{:L('no')}
            </td>
        </tr>  
        <tr>
            <th>{:L('model_is_important')} :</th>
            <td>
                <input type="radio" name="isImportant" class="radio_style" value="1" <if condition="$info.isImportant eq 1">checked="true"</if>> &nbsp;{:L('yes')}&nbsp;&nbsp;&nbsp;
                <input type="radio" name="isImportant" class="radio_style" value="0" <if condition="$info.isImportant eq 0">checked="true"</if>> &nbsp;{:L('no')}
            </td>
        </tr> 
        <tr>
            <th>{:L('model_is_test')} :</th>
            <td>
                <input type="radio" name="isTest" class="radio_style" value="1" <if condition="$info.isTest eq 1">checked="true"</if>> &nbsp;{:L('yes')}&nbsp;&nbsp;&nbsp;
                <input type="radio" name="isTest" class="radio_style" value="0" <if condition="$info.isTest eq '0'">checked="true"</if>> &nbsp;{:L('no')}
            </td>
        </tr>         
        
        <tr>
            <th>{:L('model_is_sales')} :</th>
            <td>
                <input type="radio" name="status" class="radio_style" value="1" <if condition="$info.status eq 1">checked="true"</if>> &nbsp;{:L('model_status_1')}&nbsp;&nbsp;&nbsp;
                <input type="radio" name="status" class="radio_style" value="0" <if condition="$info.status eq 0">checked="true"</if>> &nbsp;{:L('model_status_0')}
            </td>
        </tr>                                             
		<tr> 
	      <th width="80">{:L('remark')} :</th>
	      <td>
              <textarea name="remark" id="J_remark">{$info.remark}</textarea></td>
	    </tr>	    
	</table>
    <input type="hidden" name="id" value="{$info.id}" />
	</form>
</div>
<script>
$(function(){
	$.formValidator.initConfig({formid:"info_form",autotip:true,submitOnce:false});
	var check_name_url = "{:U('model/ajax_check_name', array('id'=>$info['id']))}";
	$("#J_name").formValidator({ onshow:lang.please_input+lang.model_name, onfocus:lang.please_input+lang.model_name}).inputValidator({ min:1, onerror:lang.please_input+lang.model_name}).ajaxValidator({type:"get", url:check_name_url, datatype:"html", async:'false', success:function(data){ if(data == "1"){$("#J_name").focusout();return true;}else{return false;}}, onerror:lang.model_name_exists, onwait:lang.connecting_please_wait}).defaultPassed();
	
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
    function complate(result){
        if(result.status == 1){
            $.dialog.get(result.dialog).close();
            $.pinphp.tip({content:result.msg});
            window.location.reload();
        } else {
            $.pinphp.tip({content:result.msg, icon:'alert'});
        }
    }
});
</script>